﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin.Master" AutoEventWireup="true" CodeBehind="NewsCreate.aspx.cs" Inherits="WebUI.AdminSite.News.NewsCreate" %>
<%@ Register Assembly="CKEditor.NET" Namespace="CKEditor.NET" TagPrefix="CKEditor" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script>
        function openPopup() {
            window.open('../../UploadImg.aspx', 'son', 'width=500,height=400, left=100, top=100, scrollbars=1').focus();
            
            return false;
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div class="son-find-module width_full">
        <asp:ScriptManager runat="server" ID="script"></asp:ScriptManager>
        <asp:DropDownList runat="server" ID="drpLangId">
            <asp:ListItem Value="1">Vi</asp:ListItem>
            <asp:ListItem Value="2">En</asp:ListItem>
        </asp:DropDownList>

        <span class="labelTitle">Name</span>
        <asp:TextBox runat="server" ID="txtName" CssClass="inputText"></asp:TextBox>
        <asp:RequiredFieldValidator ForeColor="red" runat="server" SetFocusOnError="True" ID="rqfName" ErrorMessage="Không được để trống"
        ControlToValidate="txtName"></asp:RequiredFieldValidator>
        
        <span class="labelTitle">Short description</span>
        <asp:TextBox runat="server" TextMode="MultiLine" Height="50px" ID="txtShortDesc" CssClass="width_full" ></asp:TextBox>
        <asp:RequiredFieldValidator runat="server" ForeColor="red" SetFocusOnError="True" ID="rqfShort" ErrorMessage="Không được để trống"
        ControlToValidate="txtShortDesc"></asp:RequiredFieldValidator>

        <span class="labelTitle">Thumbs</span>
        <input type="text" runat="server" ID="txtThumbs" class="inputText" onclick="openPopup()"  />
        <asp:HiddenField runat="server" ID="hfdImgCode" />
        
        <asp:UpdatePanel runat="server" ID="udpAjax">
            <ContentTemplate>
                <asp:CheckBox runat="server" ID="chkDisplay" AutoPostBack="True" 
            Checked="False" Text="Display Img" Width="100%" 
            oncheckedchanged="chkDisplay_CheckedChanged"/>
                <asp:Image runat="server" ID="imgDisplay" Width="120px" Visible="False" Height="120px"/>
            </ContentTemplate>
        </asp:UpdatePanel>
        
        <span class="labelTitle">Full Description</span>
        <CKEditor:CKEditorControl ID="ckey1"  BasePath="/ckeditor/" runat="server" />

        <asp:CheckBox runat="server" ID="chkHotNews" Text="Is Hot news" Width="100%"/>

        <span class="labelTitle">Index</span>
            <asp:TextBox runat="server" Width="100px"  ID="txtIndex"></asp:TextBox>
         <asp:RangeValidator runat="server" ID="rqfIndex" ErrorMessage="Chỉ nhận kiểu số"
         SetFocusOnError="True" ForeColor="red" ControlToValidate="txtIndex" MinimumValue="0" MaximumValue="100" Type="Integer"></asp:RangeValidator>   
         
          <span class="labelTitle">Review</span>
            <asp:TextBox runat="server" Width="100px"  ID="txtReview"></asp:TextBox>
         <asp:RangeValidator runat="server" ID="rqfReview" ErrorMessage="Chỉ nhận kiểu số"
         SetFocusOnError="True" ForeColor="red" ControlToValidate="txtIndex" MinimumValue="0" MaximumValue="100" Type="Integer"></asp:RangeValidator>   

         <span class="labelTitle">Category</span>
        <asp:DropDownList runat="server" ID="drpCategory" />
        <asp:RequiredFieldValidator runat="server" ID="rqfCategory"
        InitialValue="-1" ControlToValidate="drpCategory" ForeColor="red" ErrorMessage="Chọn 1 mục" SetFocusOnError="True"></asp:RequiredFieldValidator>

        <span class="labelTitle">Status</span>

        <asp:DropDownList ID="drpStatus" runat="server">
                <asp:ListItem Value="NORMAL">NORMAL</asp:ListItem>
                <asp:ListItem Value="STANDBY">STANDBY</asp:ListItem>
                <asp:ListItem Value="DELETED">DELETED</asp:ListItem>
        </asp:DropDownList>

         <div class="btnSaveDelete">
                <asp:LinkButton ID="btnSave" runat="server" onclick="btnSave_Click" >Create</asp:LinkButton>
                <asp:LinkButton ID="LinkButton1" runat="server" OnClientClick="goBack();">Back</asp:LinkButton>
            </div>
    </div>
</asp:Content>
